<?php
/**
 * Created by PhpStorm.
 * User: Sunqj
 * Date: 2017/1/11
 * Time: 上午1:08
 */
namespace app\www\controller;

use think\Controller;
use think\Db;
use think\Session;
use think\Cache;

class Commons extends Controller
{


    protected function ajaxSuccess($info = "", $extra = array())
    {
        $result = array(
            "status"=>0,
            "info" => $info,
            "data" => $extra,
        );

        die(json_encode($result, JSON_UNESCAPED_UNICODE));
    }

    /**
     * ajax失败信息
     *
     * @param string $info 信息内容
     * @param array $extra 额外数据
     */
    protected function ajaxError($info = "", $extra = array())
    {
        $result = array(
            "status"=>1,
            "info" => $info,
            "data" => $extra,
        );

        die(json_encode($result, JSON_UNESCAPED_UNICODE));
    }
}